package br.com.bankai.koby.presentation.controller;

import org.springframework.context.annotation.Scope;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;

import br.com.graflogic.utilities.presentationutil.controller.BaseController;

/**
 * 
 * @author Leonardo
 *
 */
@Controller("sessionController")
@Scope("session")
public class SessionController extends BaseController {

	private static final long serialVersionUID = -2578329135252733015L;

	public boolean isAuthenticated() {
		if (SecurityContextHolder.getContext().getAuthentication() instanceof AnonymousAuthenticationToken) {
			return false;
		}
		return true;
	}
}